<template>
  <div class="app-container">
    <div class="header">
      <div class="title">
        <i class="el-icon-data-board"></i><span>2楼多穿联动平台</span>
      </div>
      <div class="backB">
        <img src="@/assets/images/back.png" alt="" @click="goBack" />
      </div>
    </div>
    <div class="middle">
      <div class="middle-left">
        <div class="bigtitle">多穿箱库数据报表</div>
        <div class="topleft">
          <el-table
            :data="shuttleData"
            border
            v-loading="loading"
            element-loading-text="拼命加载中"
            element-loading-spinner="el-icon-loading"
            :header-cell-style="{ background: '#1890ff', color: '#ffffff' }"
            ref="table"
          >
            <el-table-column align="center" prop="area" label="巷道">
            </el-table-column>
            <el-table-column align="center" prop="areaCount" label="巷道箱位">
            </el-table-column>
            <el-table-column align="center" prop="emptyCount" label="空箱数量">
            </el-table-column>
            <!-- <el-table-column
              align="center"
              prop="allocIndicator1"
              label="空箱占用率"
            >
            </el-table-column> -->
            <el-table-column
              align="center"
              prop="notEmptyCount"
              label="载货数量"
            >
            </el-table-column>
            <el-table-column align="center" prop="useRate" label="载货占用率">
            </el-table-column>
          </el-table>
        </div>
        <div class="bigtitle">大TOB复核台数据报表</div>
        <div class="middleLeft">
          <el-table
            :data="tableData"
            border
            v-loading="loading"
            element-loading-text="拼命加载中"
            element-loading-spinner="el-icon-loading"
            :header-cell-style="{ background: '#1890ff', color: '#ffffff' }"
            ref="table"
          >
            <el-table-column align="center" prop="island" label="复核岛">
            </el-table-column>
            <el-table-column
              align="center"
              prop="sideWayNum"
              label="复核台数量"
            >
            </el-table-column>
            <el-table-column
              align="center"
              prop="sideWayUseNum"
              label="已开复核台数"
            >
            </el-table-column>
            <el-table-column align="center" prop="sideWayAvg" label="开启率">
            </el-table-column>
            <el-table-column align="center" prop="useNum" label="岛分配箱数">
            </el-table-column>
            <el-table-column
              align="center"
              prop="allocIndicator3"
              label="使用率"
            >
            </el-table-column>
            <el-table-column align="center" prop="average" label="平均箱数">
            </el-table-column>
          </el-table>
        </div>
        <div class="bigtitle">多穿箱库控制中心</div>
        <div class="bottomleft">
          <div class="checkTable">
            <span class="text1">多穿控制器</span>
            <span class="text1"
              ><el-switch
                v-model="shuttleController"
                active-color="#13ce66"
                inactive-color="#dedede"
                active-value="1"
                inactive-value="0"
              ></el-switch
            ></span>
            <span class="text1">复核台箱数</span>
            <span class="text1"
              ><el-input v-model="checkBoxNum" placeholder=""></el-input
            ></span>
          </div>
          <div class="checkTable">
            <span class="text1">入岛下限</span>
            <span class="text1"
              ><span class="textInput"
                ><el-input v-model="islandOffline" placeholder=""></el-input
                ><span class="perceremark">%</span></span
              >
            </span>
            <span class="text1">入岛上限</span>
            <span class="text1"
              ><span class="textInput"
                ><el-input
                  v-model="islandOfflineLimit"
                  placeholder=""
                ></el-input
                ><span class="perceremark">%</span></span
              ></span
            >
          </div>
          <div class="checkTable">
            <span class="textnoborder text3" @click="shuttleQuery"
              ><i class="el-icon-edit"></i>参数修改</span
            >
          </div>
          <div class="checkTable">
            <span class="text1">巷道呼出</span>
            <span class="text1"
              ><el-select v-model="callType" placeholder="请选择">
                <el-option
                  v-for="item in optionsCallOut"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option> </el-select
            ></span>
          </div>
          <div class="checkTable" v-if="callType == 4">
            <span class="text1">指定箱号呼出</span>
            <span class="text1"
              ><el-input
                v-model="boxcallout"
                placeholder="请输入6位箱号"
              ></el-input
            ></span>
            <span class="text1">复核台号</span>
            <span class="text1"
              ><el-select
                v-model="locationNo"
                filterable
                placeholder="请选择复核台"
              >
                <el-option
                  v-for="dict in dict.type.location_no"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                >
                </el-option> </el-select
            ></span>
            <!-- <el-select v-model="value" filterable placeholder="请选择">
              <el-option
                v-for="item in optionsone"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select> -->
          </div>
          <div class="checkTable">
            <span class="textnoborder text3" @click="shuttleCallOutbound"
              ><i class="el-icon-microphone"></i>呼叫</span
            >
          </div>
        </div>
      </div>
      <div class="topright">
        <div class="bigtitle">箱号复核台查询</div>
        <div class="right-top">
          <div class="checkTable">
            <el-form
              :model="queryParams"
              size="large"
              :inline="true"
              ref="queryForm"
              :rules="formRules"
            >
              <el-form-item label="复核台跟踪查询:" prop="term">
                <el-input
                  v-model="queryParams.term"
                  placeholder="拆分单号/箱号/订单号"
                  clearable
                  @keyup.enter.native="handleQuery"
                />
              </el-form-item>
              <el-form-item>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="medium"
                  @click="handleQuery"
                  >搜索</el-button
                >
                <el-button
                  type="primary"
                  icon="el-icon-refresh"
                  size="medium"
                  @click="resetQuery"
                  >重置</el-button
                >
              </el-form-item>
            </el-form>
          </div>
          <div class="checkTable">
            <span class="text1">复核岛</span>
            <span class="text1">{{ islandNo }}</span>
            <span class="text1">复核台</span>
            <span class="text1">{{ checkNo }}</span>
          </div>
        </div>
        <div class="bigtitle">箱号多穿位查询</div>
        <div class="right-bottom">
          <div class="checkTable">
            <el-form
              :model="queryParamsterm"
              size="large"
              :inline="true"
              ref="queryFormterm"
              :rules="formRulesterm"
            >
              <el-form-item label="拆分单号/箱号/订单号:" prop="term">
                <el-input
                  v-model="queryParamsterm.term"
                  placeholder="拆分单号/箱号/订单号"
                  clearable
                  @keyup.enter.native="termQuery"
                />
              </el-form-item>
              <el-form-item>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  size="medium"
                  @click="termQuery"
                  >搜索</el-button
                >
                <el-button
                  type="primary"
                  icon="el-icon-refresh"
                  size="medium"
                  @click="termresetQuery"
                  >重置</el-button
                >
              </el-form-item>
            </el-form>
          </div>
          <div class="checkTable">
            <span class="text1">巷道</span>
            <span class="text1">{{ roadway }}</span>
            <span class="text1">点位</span>
            <span class="text1">{{ shuttlePoint }}</span>
            <span class="text1">入仓时间</span>
            <span class="text1 textTime">{{ shuttleTime }}</span>
          </div>
        </div>
        <div class="bigtitle">巷道小车任务接收控制</div>
        <div class="rightRoadway">
          <div class="checkTable3">
            <span class="text1">巷道1</span>
            <span class="text1"
              ><el-select v-model="carryCount1" placeholder="请选择">
                <el-option
                  v-for="item in optionsRoadway"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option> </el-select></span
            ><span class="text1 text3" @click="areaNofirstQuery"
              ><i class="el-icon-edit"></i>巷道1修改</span
            >
          </div>
          <div class="checkTable3">
            <span class="text1">巷道2</span>
            <span class="text1"
              ><el-select v-model="carryCount2" placeholder="请选择">
                <el-option
                  v-for="item in optionsRoadway"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option> </el-select></span
            ><span class="text1 text3" @click="areaNoSecordQuery"
              ><i class="el-icon-edit"></i>巷道2修改</span
            >
          </div>
          <div class="checkTable3">
            <span class="text1">巷道3</span>
            <span class="text1"
              ><el-select v-model="carryCount3" placeholder="请选择">
                <el-option
                  v-for="item in optionsRoadway"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option> </el-select></span
            ><span class="text1 text3" @click="areaNoThreeQuery"
              ><i class="el-icon-edit"></i>巷道3修改</span
            >
          </div>
          <!-- <div class="checkTable">
            <span class="textnoborder text3" @click="shuttlePointQuery"
              ><i class="el-icon-edit"></i>参数修改</span
            >
          </div> -->
        </div>
        <div class="bigtitle">空箱出入多穿控制</div>
        <div class="rightemptyBoxNum">
          <div class="checkTable">
            <span class="emptyBox">是否进出多穿或者201是否绑箱</span>
            <span class="text1"
              ><el-select v-model="isBindContainer" placeholder="请选择">
                <el-option
                  v-for="item in optionsBindContainer"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option> </el-select
            ></span>
          </div>
          <div class="checkTable">
            <span class="emptyBox">进多穿空箱数量</span>
            <span class="text1"
              ><el-input v-model="shuttleEmptyNum" placeholder=""></el-input
            ></span>
          </div>
          <div class="checkTable">
            <span class="emptyBox">多穿空箱一次绑箱数量</span>
            <span class="text1">
              <el-input v-model="shuttleBindNum" placeholder=""></el-input>
            </span>
          </div>
          <div class="checkTable">
            <span class="textnoborder text3" @click="updateEmptyShuttle"
              ><i class="el-icon-edit"></i>空箱出入多穿修改</span
            >
          </div>
        </div>
      </div>
    </div>
    <div class="footer">
      <el-dialog
        title="操作验证"
        :visible.sync="centerDialogVisible"
        width="22%"
        left
        :close-on-click-modal="false"
      >
        <el-form
          :model="passForm"
          status-icon
          :rules="passrules"
          ref="passForm"
          label-width="60px"
          class="demo-ruleForm"
        >
          <el-form-item label="密码" prop="pass">
            <el-input
              type="password"
              v-model="passForm.pass"
              autocomplete="off"
            ></el-input>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button @click="centerDialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="submit('passForm')"
            >确 定</el-button
          >
        </span>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import {
  getfindIslandData,
  getfindCheckNo,
  getfindShuttleData,
  getfindShuttleByTerm,
  getfindSysParam,
  getUpdateShuttle,
  getareaNo,
  getUpdateAreaCount,
  getfindEmptySysParam,
  getUpdateEmptyShuttle,
  getshuttleCallOutbound,
} from "@/api/multiPass";
import {
  getcheckPassword,
  multiplelist,
  spslist,
} from "@/api/subSystem/continer";
export default {
  dicts: ["location_no"],
  data() {
    var passwordError = (rule, value, callback) => {
      if (!value) {
        return callback(new Error("密码不能为空"));
      } else {
        getcheckPassword(value).then((res) => {
          if (res.msg == "admin") {
            callback();
          } else if (res.msg == "false") {
            callback(new Error("密码错误"));
          }
        });
      }
    };
    return {
      // optionsone: [
      //   {
      //     value: "1",
      //     label: "F001",
      //   },
      //   {
      //     value: "2",
      //     label: "F135",
      //   },
      //   {
      //     value: "3",
      //     label: "F056",
      //   },
      //   {
      //     value: "4",
      //     label: "F387",
      //   },
      //   {
      //     value: "选项5",
      //     label: "北京烤鸭",
      //   },
      //   {
      //     value: "选项6",
      //     label: "黄金糕",
      //   },
      //   {
      //     value: "选项7",
      //     label: "双皮奶",
      //   },
      //   {
      //     value: "选项8",
      //     label: "蚵仔煎",
      //   },
      //   {
      //     value: "选项9",
      //     label: "龙须面",
      //   },
      //   {
      //     value: "选项10",
      //     label: "北京烤鸭",
      //   },
      //   {
      //     value: "选项1",
      //     label: "黄金糕",
      //   },
      //   {
      //     value: "选项2",
      //     label: "双皮奶",
      //   },
      //   {
      //     value: "选项3",
      //     label: "蚵仔煎",
      //   },
      //   {
      //     value: "选项4",
      //     label: "龙须面",
      //   },
      //   {
      //     value: "选项5",
      //     label: "北京烤鸭",
      //   },
      //   {
      //     value: "选项6",
      //     label: "黄金糕",
      //   },
      //   {
      //     value: "选项7",
      //     label: "双皮奶",
      //   },
      //   {
      //     value: "选项8",
      //     label: "蚵仔煎",
      //   },
      //   {
      //     value: "选项9",
      //     label: "龙须面",
      //   },
      //   {
      //     value: "选项10",
      //     label: "北京烤鸭",
      //   },
      //   {
      //     value: "选项11",
      //     label: "黄金糕",
      //   },
      //   {
      //     value: "选项12",
      //     label: "双皮奶",
      //   },
      //   {
      //     value: "选项13",
      //     label: "蚵仔煎",
      //   },
      //   {
      //     value: "选项14",
      //     label: "龙须面",
      //   },
      //   {
      //     value: "选项15",
      //     label: "北京烤鸭",
      //   },
      // ],
      // value: "",
      // 弹窗
      centerDialogVisible: false,
      passForm: {
        pass: null,
      },
      passrules: {
        pass: [{ validator: passwordError, trigger: "blur" }],
      },
      errorvalue: null,
      // 复核岛
      islandNo: null,
      // 复核台
      checkNo: null,
      input: null,
      // 总条数
      total: 0,
      loading: false,
      // 查询复核岛复核台数据
      queryParams: {
        term: null,
        // pageNum: 1,
        // pageSize: 15,
      },
      formRules: {
        term: [{ required: true, message: "请输入查询条件", trigger: "blur" }],
      },
      // 根据拆分单号/箱号/订单号查询多穿数据
      queryParamsterm: {
        term: null,
      },
      formRulesterm: {
        term: [{ required: true, message: "请输入查询条件", trigger: "blur" }],
      },
      // 巷道
      roadway: null,
      // 点位
      shuttlePoint: null,
      // 入仓时间
      shuttleTime: null,
      // 复核岛数据
      tableData: [],
      // 多穿数据
      shuttleData: [],
      // 多穿控制器
      shuttleController: "",
      // 入岛下限
      islandOffline: null,
      // 入岛上限
      islandOfflineLimit: null,
      // 指定箱号呼出
      boxcallout: null,
      // 巷道呼出
      callType: null,
      // 复核台号
      locationNo: null,
      optionsCallOut: [
        {
          value: 1,
          label: "巷道1",
        },
        {
          value: 2,
          label: "巷道2",
        },
        {
          value: 3,
          label: "巷道3",
        },
        {
          value: 0,
          label: "全仓呼出",
        },
        {
          value: 4,
          label: "指定箱号呼出",
        },
        // {
        //   value: 5,
        //   label: "载货一键呼出",
        // },
        {
          value: 6,
          label: "追箱一键呼出",
        },
      ],
      optionsRoadway: [
        {
          value: 1,
          label: "1",
        },
        {
          value: 2,
          label: "2",
        },
        {
          value: 3,
          label: "3",
        },
        {
          value: 4,
          label: "4",
        },
      ],
      // 复核台箱数
      checkBoxNum: null,
      // 巷道1
      carryCount1: null,
      // 巷道2
      carryCount2: null,
      // 巷道3
      carryCount3: null,
      // 是否进出多穿
      optionsBindContainer: [
        {
          value: 1,
          label: "B2F201绑箱",
        },
        {
          value: 2,
          label: "多穿入空箱",
        },
        {
          value: 3,
          label: "多穿绑箱",
        },
      ],
      // 是否进出多穿或者201是否绑箱
      isBindContainer: null,
      // 进多穿空箱数量
      shuttleEmptyNum: null,
      // 多穿空箱一次绑箱数量
      shuttleBindNum: null,
      // 全局变量修改巷道
      areaNovalue: 0,
      // 多穿有货箱号列表
      multipledata: [],
      // 多穿异常箱号列表
      excemultipledata: [],
    };
  },
  created() {},
  mounted() {
    this.findIslandData();
    this.findShuttleData();
    this.findSysParam();
    this.findareaNo();
    this.findEmptySysParam();
    this.multiplelistData();
    this.excemultiplelistData();
  },
  beforeDestroy() {},
  methods: {
    // 获取多穿异常箱号
    excemultiplelistData() {
      multiplelist({ type: "E" }).then((res) => {
        console.log("多穿异常", res);
        this.excemultipledata = res.data;
      });
    },
    // 获取多穿有货箱号
    multiplelistData() {
      multiplelist({ type: "N" }).then((res) => {
        console.log("多穿", res);
        this.multipledata = res.data;
      });
    },
    // 查询空箱进出入多穿情况
    findEmptySysParam() {
      getfindEmptySysParam().then((res) => {
        this.isBindContainer = res.data.isBindContainer;
        this.shuttleEmptyNum = res.data.shuttleEmptyNum;
        this.shuttleBindNum = res.data.shuttleBindNum;
      });
    },
    // 修改空箱是否进出多穿
    updateEmptyShuttle() {
      this.centerDialogVisible = true;
      this.passForm.pass = null;
      this.areaNovalue = 5;
      // console.log(
      //   this.isBindContainer,
      //   parseInt(this.shuttleEmptyNum),
      //   parseInt(this.shuttleBindNum)
      // );
    },
    findareaNo() {
      getareaNo({ areaNo: "SPS0" }).then((res) => {
        // console.log(res);
        this.carryCount1 = res.data.list[0].carryCount;
        this.carryCount2 = res.data.list[1].carryCount;
        this.carryCount3 = res.data.list[2].carryCount;
      });
    },
    // 修改巷道1
    areaNofirstQuery() {
      this.centerDialogVisible = true;
      this.areaNovalue = 1;
      this.passForm.pass = null;
    },
    areaNoSecordQuery() {
      this.centerDialogVisible = true;
      this.areaNovalue = 2;
      this.passForm.pass = null;
    },
    areaNoThreeQuery() {
      this.centerDialogVisible = true;
      this.areaNovalue = 3;
      this.passForm.pass = null;
    },
    findSysParam() {
      getfindSysParam().then((res) => {
        this.shuttleController = res.data.shuttleController;
        this.islandOffline = res.data.islandOffline * 100;
        this.islandOfflineLimit = res.data.islandOfflineLimit * 100;
        this.checkBoxNum = res.data.checkBoxNum;
        localStorage.setItem("checkBoxNum", this.checkBoxNum);
        // console.log(111, this.checkBoxNum);
        this.findIslandData();
      });
    },
    findIslandData() {
      let checkBoxNum = localStorage.getItem("checkBoxNum");
      // console.log(222, checkBoxNum);
      getfindIslandData().then((res) => {
        this.tableData = res.data;
        this.tableData.forEach((item) => {
          let sideWayNum = parseInt(item.sideWayNum);
          let useNum = parseInt(item.useNum);
          let sideWayUseNum = parseInt(item.sideWayUseNum);
          item.sideWayAvg = (item.sideWayAvg * 100).toFixed(2) + "%";
          item.allocIndicator3 =
            ((useNum / (sideWayUseNum * checkBoxNum)) * 100).toFixed(2) + "%";
          item.average = (useNum / sideWayUseNum).toFixed(1);
        });
      });
    },
    // findShuttleData() {
    //   getfindShuttleData().then((res) => {
    //     this.shuttleData = res.data;
    //     this.shuttleData.forEach((item) => {
    //       let useNum = parseInt(item.useNum);
    //       let shuttleNum = parseInt(item.shuttleNum);
    //       item.useRate = ((useNum / shuttleNum) * 100).toFixed(2) + "%";
    //     });
    //   });
    // },
    findShuttleData() {
      spslist().then((res) => {
        this.shuttleData = res.data;
        this.shuttleData.forEach((item) => {
          let useNum = parseInt(item.notEmptyCount);
          let shuttleNum = parseInt(item.areaCount);
          item.useRate = ((useNum / shuttleNum) * 100).toFixed(2) + "%";
        });
      });
    },
    // 查询复核岛复核台数据
    handleQuery() {
      this.$refs.queryForm.validate((valid) => {
        if (valid) {
          getfindCheckNo(this.queryParams).then((res) => {
            if (res.data == null) {
              this.checkNo = null;
              this.islandNo = null;
              this.$modal.msgError("未查到相关数据");
            } else {
              this.checkNo = res.data.checkNo;
              this.islandNo = res.data.islandNo;
            }
          });
        }
      });
    },
    // 查询多穿数据
    termQuery() {
      this.$refs.queryFormterm.validate((valid) => {
        if (valid) {
          getfindShuttleByTerm(this.queryParamsterm).then((res) => {
            if (res.data == null) {
              this.roadway = null;
              this.shuttlePoint = null;
              this.shuttleTime = null;
              this.$modal.msgError("未查到相关数据");
            } else {
              this.roadway = res.data.roadway;
              this.shuttlePoint = res.data.shuttlePoint;
              this.shuttleTime = res.data.shuttleTime;
            }
          });
        }
      });
    },
    resetQuery() {
      this.queryParams.term = null;
      this.checkNo = null;
      this.islandNo = null;
    },
    termresetQuery() {
      this.queryParamsterm.term = null;
      this.roadway = null;
      this.shuttlePoint = null;
      this.shuttleTime = null;
    },
    //修改多穿控制器数据
    shuttleQuery() {
      this.centerDialogVisible = true;
      this.passForm.pass = null;
      this.areaNovalue = 4;
    },
    // 呼叫多穿出库
    shuttleCallOutbound() {
      this.centerDialogVisible = true;
      this.passForm.pass = null;
      this.areaNovalue = 6;
    },
    // 修改复核台箱数
    checkBoxQuery() {},
    // 修改入岛上线
    // 合法性
    // getcheckPassword(this.passForm.pass).then((res) => {
    //   this.errorvalue=res.msg;
    // });
    // if(this.passForm.pass=="1234"){
    //   this.errorvalue=true;
    //   console.log(this.errorvalue);
    // }else{
    //   this.errorvalue=false;
    //   console.log(this.errorvalue);
    // }
    submit(formName) {
      console.log("areaNovalue", this.areaNovalue);
      this.$refs[formName].validate((valid) => {
        if (valid) {
          if (this.areaNovalue == 1) {
            getUpdateAreaCount({
              areaNo: "SPS01",
              carryCount: this.carryCount1,
            }).then((res) => {
              console.log(res);
              this.findareaNo();
            });
          } else if (this.areaNovalue == 2) {
            getUpdateAreaCount({
              areaNo: "SPS02",
              carryCount: this.carryCount2,
            }).then((res) => {
              console.log(res);
              this.findareaNo();
            });
          } else if (this.areaNovalue == 3) {
            getUpdateAreaCount({
              areaNo: "SPS03",
              carryCount: this.carryCount3,
            }).then((res) => {
              console.log(res);
              this.findareaNo();
            });
          } else if (this.areaNovalue == 4) {
            getUpdateShuttle({
              shuttleController: this.shuttleController,
              islandOffline: (this.islandOffline / 100).toString(),
              checkBoxNum: this.checkBoxNum,
              islandOfflineLimit: (this.islandOfflineLimit / 100).toString(),
            }).then((res) => {
              console.log(res);
              this.findSysParam();
            });
          } else if (this.areaNovalue == 5) {
            getUpdateEmptyShuttle({
              isBindContainer: this.isBindContainer,
              shuttleEmptyNum: parseInt(this.shuttleEmptyNum),
              shuttleBindNum: parseInt(this.shuttleBindNum),
            }).then((res) => {
              console.log(res);
              this.findEmptySysParam();
            });
          } else if (this.areaNovalue == 6) {
            if (this.callType == 4) {
              this.callType = null;
              getshuttleCallOutbound({
                containerNo: this.boxcallout,
                callType: this.callType,
                locationNo: this.locationNo,
              }).then((res) => {
                console.log(res);
              });
            } else if (this.callType == 5) {
              this.callType = null;
              const executePromises = async () => {
                if (
                  Array.isArray(this.multipledata) &&
                  this.multipledata.length > 0
                ) {
                  for (const item of this.multipledata) {
                    console.log(
                      "containerNo",
                      item.boxNo,
                      item.checkNo,
                      this.callType
                    );
                    try {
                      const result = await getshuttleCallOutbound({
                        containerNo: item.boxNo,
                        callType: this.callType,
                        locationNo: item.checkNo,
                      });
                      console.log(result);
                    } catch (error) {
                      console.error(error);
                    } finally {
                      await new Promise((resolve) => setTimeout(resolve, 1000));
                    }
                  }
                }
              };
              executePromises();
            } else if (this.callType == 6) {
              this.callType = null;
              const exceCargo = async () => {
                if (
                  Array.isArray(this.excemultipledata) &&
                  this.excemultipledata.length > 0
                ) {
                  for (const item of this.excemultipledata) {
                    console.log(
                        "containerNo",
                        item.boxNo,
                        item.checkNo,
                        this.callType
                      );
                    try {
                      const result = await getshuttleCallOutbound({
                        containerNo: item.boxNo,
                        callType: this.callType,
                        locationNo: item.checkNo,
                      });
                      console.log(result);
                    } catch (error) {
                      console.error(error);
                    } finally {
                      await new Promise((resolve) => setTimeout(resolve, 1000));
                    }
                  }
                }
              };
              exceCargo();
            } else {
              this.boxcallout = "";
              this.locationNo = "";
              getshuttleCallOutbound({
                containerNo: this.boxcallout,
                callType: this.callType,
                locationNo: this.locationNo,
              }).then((res) => {
                console.log(res);
              });
            }
            // console.log("巷道呼出", this.callType);
            // console.log("指定箱号呼出", this.boxcallout);
            // console.log("复核台", this.locationNo);
          }
          this.centerDialogVisible = false;
        }
      });
    },

    goBack() {
      this.$router.push("/subSystem1");
    },
  },
};
</script>

<style lang="scss" src='@/assets/styles/multipass1.scss' scoped>
</style>
